import Vue from 'vue'
import VueRouter from 'vue-router'
import user from '@/views/user'
import Login from '@/views/login'
import Register from '@/views/register'
import Note from '@/views/note'
import Chat from '@/views/chat'
import Album from '@/views/album'
import zh from '@/zh'

Vue.use(VueRouter)

const routes = [
  // 用户游乐区,代号1
  {
    path: '/note',
    name: 'Note',
    component: Note,
    meta: { title: zh('meta.note.title'), sid: zh('meta.note.sid') }
  },
  {
    path: '/chat',
    name: 'Chat',
    component: Chat,
    meta: { title: zh('meta.chat.title'), sid: zh('meta.chat.sid') }
  },
  {
    path: '/album',
    name: 'Album',
    component: Album,
    meta: { title: zh('meta.album.title'), sid: zh('meta.album.sid') }
  },
  // 用户管理区,代号2
  {
    path: '/user',
    name: 'User',
    component: user,
    meta: { title: zh('meta.user.title'), sid: zh('meta.user.sid') }
  },
  {
    path: '/login',
    name: 'Login',
    component: Login,
    meta: { title: zh('meta.login.title'), sid: zh('meta.login.sid') }
  },
  {
    path: '/register',
    name: 'Register',
    component: Register,
    meta: { title: zh('meta.register.title'), sid: zh('meta.register.sid') }
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
